Optimal. Leaf size=48 \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{b \sec (c+d x)}{d}-\frac{b \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.111308, antiderivative size = 48, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2838, 2620, 14, 2622, 321, 207} \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{b \sec (c+d x)}{d}-\frac{b \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2620
Rule 14
Rule 2622
Rule 321
Rule 207
Rubi steps
\begin{align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx &=a \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+b \int \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=\frac{a \operatorname{Subst}\left (\int \frac{1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac{b \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac{b \sec (c+d x)}{d}+\frac{a \operatorname{Subst}\left (\int \left (1+\frac{1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac{b \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{a \cot (c+d x)}{d}+\frac{b \sec (c+d x)}{d}+\frac{a \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.0756153, size = 68, normalized size = 1.42 \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{b \sec (c+d x)}{d}+\frac{b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{d}-\frac{b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.053, size = 69, normalized size = 1.4 \begin{align*}{\frac{a}{d\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }}-2\,{\frac{\cot \left ( dx+c \right ) a}{d}}+{\frac{b}{d\cos \left ( dx+c \right ) }}+{\frac{b\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.03981, size = 80, normalized size = 1.67 \begin{align*} \frac{b{\left (\frac{2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a{\left (\frac{1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.66065, size = 269, normalized size = 5.6 \begin{align*} -\frac{b \cos \left (d x + c\right ) \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - b \cos \left (d x + c\right ) \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) + 4 \, a \cos \left (d x + c\right )^{2} - 2 \, b \sin \left (d x + c\right ) - 2 \, a}{2 \, d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.21435, size = 139, normalized size = 2.9 \begin{align*} \frac{6 \, b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{2 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 15 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 10 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 3 \, a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]